<style>
.new_question {
    display:none;
}
</style>

<div style="margin:0 auto;">
<h1>添加新面试题</h1>

<form method="post">
<span>试题类型</span>
<input type="radio" name="question_type" value="select" onclick="show_question_input('select_question');">选择题
<input type="radio" name="question_type" value="blank" onclick="show_question_input('blank_question');">填空题
<input type="radio" name="question_type" value="judge" onclick="show_question_input('judge_question');">判断题
<input type="radio" name="question_type" value="answer" onclick="show_question_input('answer_question');">问答题

<div id="select_question" class="new_question">
<span>试题</span><textarea name="select_question" cols="70" rows="2"></textarea><br />
<span>A</span><input type="text" name="a_select" size="70"/><br />
<span>B</span><input type="text" name="b_select" size="70"/><br />
<span>C</span><input type="text" name="c_select" size="70"/><br />
<span>D</span><input type="text" name="d_select" size="70"/><br />
<span>正确选项</span>
<input type="radio" name="select_answer" value="1" /> A 
<input type="radio" name="select_answer" value="2" /> B 
<input type="radio" name="select_answer" value="3" /> C 
<input type="radio" name="select_answer" value="4" /> D 
</div>

<div id="blank_question" class="new_question">
<div>编题示例！</div>
<span>试题</span><textarea name="blank_question" cols="70" rows="2"></textarea><br />
<span>答案</span><textarea name="answer" cols="70" rows="10"></textarea>
</div>

<div id="judge_question" class="new_question">
<span>试题</span><textarea name="judge_question" cols="70" rows="2"></textarea><br />
<span>对错</span>
<input type="radio" name="judge_answer" value="1" /> 对 
<input type="radio" name="judge_answer" value="0" /> 错 
</div>

<div id="answer_question" class="new_question">
<span>试题</span><textarea name="question" cols="70" rows="2"></textarea><br />
<span>答案</span><textarea name="answer" cols="70" rows="10"></textarea>
</div>

<div>
<input type="submit" value="添加">
</div>
</form> 

</div>

<script>
$(function() {
    show_question_input('select_question');
});

function show_question_input(question_type) {
    $('.new_question').hide();
    $('#'+question_type).show(); 
}

</script>
